package com.taoyige.bean;

import java.io.InputStream;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.taoyige.common.JacksonJsonUtil;

/**
 * 地址实体类
 * @author peter
 * @version 1.0
 * @created 2014-11-13
 */
@JsonIgnoreProperties(ignoreUnknown=true)
public class Address extends Entity{
	
	public final static String ADDR_ID = "id";
	public final static String ADDR_USER_ID = "userID";
	public final static String ADDR_NAME = "name";
	public final static String ADDR_PROVINCE = "province";
	public final static String ADDR_CITY = "city";
	public final static String ADDR_COUNTY = "county";
	public final static String ADDR_STREET = "street";
	public final static String ADDR_DETAILS = "details";
	public final static String ADDR_MOBILE_PHONE = "mobilephone";
	public final static String ADDR_TELEPHONE = "telephone";
	public final static String ADDR_POSTCODE = "postcode";
	public final static String ADDR_SET_DEFAULT = "setDefault";

	private String userID;
	private String name;
	private String province;
	private String city;
	private String county;
	private String provinceText;
	private String cityText;
	private String countyText;
	private String street;
	private String details;
	private String mobilephone;
	private Integer telephone;
	private Integer postcode;
	private Boolean setDefault;
	private String action;
	private String timestamp;
	
	public String getProvinceText() {
		return provinceText;
	}

	public void setProvinceText(String provinceText) {
		this.provinceText = provinceText;
	}

	public String getCityText() {
		return cityText;
	}

	public void setCityText(String cityText) {
		this.cityText = cityText;
	}

	public String getCountyText() {
		return countyText;
	}

	public void setCountyText(String countyText) {
		this.countyText = countyText;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}

	public String getUserID() {
		return userID;
	}

	public void setUserID(String userID) {
		this.userID = userID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getDetails() {
		return details;
	}

	public void setDetails(String details) {
		this.details = details;
	}

	public String getMobilephone() {
		return mobilephone;
	}

	public void setMobilephone(String mobilephone) {
		this.mobilephone = mobilephone;
	}

	public Integer getTelephone() {
		return telephone;
	}

	public void setTelephone(Integer telephone) {
		this.telephone = telephone;
	}

	public Integer getPostcode() {
		return postcode;
	}

	public void setPostcode(Integer postcode) {
		this.postcode = postcode;
	}

	public Boolean getSetDefault() {
		return setDefault;
	}

	public void setSetDefault(Boolean setDefault) {
		this.setDefault = setDefault;
	}

	public static Address  parse(InputStream ins) throws Exception {
		Address addr = (Address) JacksonJsonUtil.jsonToBean(ins, Address.class);
		return addr;
	}
	
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.SHORT_PREFIX_STYLE);
	}
	
}
